/* Message Display Styles */
.assistant-message {
  max-width: 78%;
  border-radius: 18px;
  padding: 14px 18px;
  backdrop-filter: blur(12px);
  border: 1px solid;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  position: relative;
}

.assistant-message.dark {
  background: linear-gradient(135deg, 
    rgba(60, 23, 34, 0.85) 0%, 
    rgba(42, 21, 29, 0.90) 50%,
    rgba(31, 19, 23, 0.95) 100%);
  border: 1px solid rgba(200, 30, 58, 0.15);
  color: #fafafa;
  box-shadow: 
    0 8px 32px rgba(200, 30, 58, 0.1),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  backdrop-filter: blur(16px);
}

.assistant-message.light {
  background: linear-gradient(135deg, 
    rgba(255, 249, 245, 0.95) 0%, 
    rgba(255, 245, 238, 0.98) 50%,
    rgba(255, 240, 230, 0.98) 100%);
  border: 1px solid rgba(255, 140, 100, 0.2);
  color: #2d1b13;
  box-shadow: 
    0 8px 32px rgba(255, 140, 100, 0.08),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  backdrop-filter: blur(12px);
}

.user-message {
  border-radius: 16px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.15);
  max-width: 70%;
  word-wrap: break-word;
}

.user-message.dark {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}

.user-message.light {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
  color: white;
  box-shadow: 0 4px 16px rgba(249, 115, 22, 0.3);
}

.message-content {
  font-size: 14px;
  line-height: 1.6;
  font-weight: 400;
}

/* Typography Styles */
.message-h1 {
  font-size: 20px;
  font-weight: 700;
  margin: 18px 0 12px 0;
  color: inherit;
  border-bottom: 2px solid;
  padding-bottom: 6px;
}

.assistant-message.dark .message-h1 {
  border-bottom-color: rgba(255, 255, 255, 0.15);
}

.assistant-message.light .message-h1 {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.message-h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 16px 0 10px 0;
  color: inherit;
}

.message-h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 14px 0 7px 0;
  color: inherit;
}

.message-p {
  margin: 10px 0;
  color: inherit;
}

.message-ul, .message-ol {
  margin: 10px 0;
  padding-left: 20px;
}

.message-li {
  margin: 4px 0;
  color: inherit;
}

.message-blockquote {
  margin: 12px 0;
  padding: 12px 16px;
  border-left: 3px solid;
  border-radius: 6px;
  font-style: italic;
}

.assistant-message.dark .message-blockquote {
  background: rgba(255, 255, 255, 0.05);
  border-left-color: #dc2626;
  color: #d1d5db;
}

.assistant-message.light .message-blockquote {
  background: rgba(0, 0, 0, 0.03);
  border-left-color: #f97316;
  color: #6b7280;
}

.message-strong {
  font-weight: 700;
  color: inherit;
}

.message-em {
  font-style: italic;
  color: inherit;
}

.message-link {
  text-decoration: underline;
  transition: all 0.2s ease;
}

.assistant-message.dark .message-link {
  color: #60a5fa;
}

.assistant-message.dark .message-link:hover {
  color: #93c5fd;
}

.assistant-message.light .message-link {
  color: #2563eb;
}

.assistant-message.light .message-link:hover {
  color: #1d4ed8;
}

/* Table Styles */
.message-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid;
}

.assistant-message.dark .message-table {
  border-color: rgba(255, 255, 255, 0.1);
}

.assistant-message.light .message-table {
  border-color: rgba(0, 0, 0, 0.1);
}

.message-th, .message-td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid;
}

.assistant-message.dark .message-th,
.assistant-message.dark .message-td {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.assistant-message.light .message-th,
.assistant-message.light .message-td {
  border-bottom-color: rgba(0, 0, 0, 0.1);
}

.message-th {
  font-weight: 600;
}

.assistant-message.dark .message-th {
  background: rgba(255, 255, 255, 0.05);
}

.assistant-message.light .message-th {
  background: rgba(0, 0, 0, 0.03);
}

/* Code Block Styles */
.code-block-wrapper {
  margin: 16px 0;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid;
  background: transparent;
}

.code-pre-wrapper {
  margin: 0;
  padding: 0;
}

.code-block-wrapper.dark {
  border-color: rgba(200, 30, 58, 0.2);
}

.code-block-wrapper.light {
  border-color: rgba(255, 140, 100, 0.3);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid;
}

.code-header.dark {
  background: linear-gradient(135deg, 
    rgba(31, 19, 23, 0.9) 0%, 
    rgba(20, 15, 18, 0.95) 100%);
  border-bottom: 1px solid rgba(200, 30, 58, 0.2);
  color: #d1d5db;
}

.code-header.light {
  background: linear-gradient(135deg, 
    rgba(255, 245, 238, 0.9) 0%, 
    rgba(255, 240, 230, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 140, 100, 0.3);
  color: #8b5a3c;
}

.language-label {
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.copy-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
}

.copy-button.dark {
  color: #9ca3af;
}

.copy-button.dark:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f3f4f6;
}

.copy-button.light {
  color: #6b7280;
}

.copy-button.light:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #374151;
}

.code-block {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 13px;
  line-height: 1.5;
  border: none;
  border-radius: 0;
}

.code-block.dark {
  background: linear-gradient(135deg, 
    rgba(15, 12, 14, 0.95) 0%, 
    rgba(20, 15, 18, 0.98) 50%,
    rgba(10, 8, 10, 0.99) 100%);
  color: #f1f5f9;
  border: 1px solid rgba(200, 30, 58, 0.1);
}

.code-block.light {
  background: linear-gradient(135deg, 
    rgba(255, 250, 245, 0.98) 0%, 
    rgba(255, 245, 238, 0.99) 50%,
    rgba(254, 240, 230, 0.99) 100%);
  color: #2d1b13;
  border: 1px solid rgba(255, 140, 100, 0.2);
}

/* Syntax Highlighting */
.code-block.dark .hljs-keyword,
.code-block.dark .hljs-selector-tag,
.code-block.dark .hljs-built_in {
  color: #ff6b9d; /* Bright pink for keywords */
}

.code-block.dark .hljs-string,
.code-block.dark .hljs-attr {
  color: #4ade80; /* Bright green for strings */
}

.code-block.dark .hljs-number,
.code-block.dark .hljs-literal {
  color: #fcd34d; /* Bright yellow for numbers */
}

.code-block.dark .hljs-comment {
  color: #6b7280; /* Gray for comments */
  font-style: italic;
}

.code-block.dark .hljs-function,
.code-block.dark .hljs-title {
  color: #7dd3fc; /* Bright cyan for functions */
}

.code-block.dark .hljs-variable,
.code-block.dark .hljs-name {
  color: #c084fc; /* Bright purple for variables */
}

.code-block.dark .hljs-type,
.code-block.dark .hljs-class {
  color: #fb7185; /* Rose for types */
}

.code-block.light .hljs-keyword,
.code-block.light .hljs-selector-tag,
.code-block.light .hljs-built_in {
  color: #be185d; /* Dark pink for keywords */
}

.code-block.light .hljs-string,
.code-block.light .hljs-attr {
  color: #059669; /* Dark green for strings */
}

.code-block.light .hljs-number,
.code-block.light .hljs-literal {
  color: #d97706; /* Dark yellow for numbers */
}

.code-block.light .hljs-comment {
  color: #6b7280; /* Gray for comments */
  font-style: italic;
}

.code-block.light .hljs-function,
.code-block.light .hljs-title {
  color: #2563eb; /* Dark blue for functions */
}

.code-block.light .hljs-variable,
.code-block.light .hljs-name {
  color: #7c3aed; /* Dark purple for variables */
}

.code-block.light .hljs-type,
.code-block.light .hljs-class {
  color: #e11d48; /* Dark rose for types */
}

/* Inline Code */
.inline-code {
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
}

.inline-code.dark {
  background: rgba(200, 30, 58, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(200, 30, 58, 0.25);
}

.inline-code.light {
  background: rgba(255, 140, 100, 0.15);
  color: #c2410c;
  border: 1px solid rgba(255, 140, 100, 0.3);
}
